<template>
	<view class="content" :style="{
      'padding-top': height + 'px',
      'box-sizing': 'border-box',
    }">
		<view :style="{
        width: '100%',
        height: statusBarHeight + 'px',
        background: 'white',
        position: 'fixed',
        top: 0,
        zIndex: 100,
      }">
		</view>
		<view class="head" :style="{
        top: statusBarHeight + 'px',
      }">
			<view class="head_left">
				<u-icon name="arrow-left" color="#444444" size="24" :bold="true" @click="toBack"></u-icon>
			</view>
			<view class="text">我的{{ type == 1 ? "研修" : "大成" }}</view>
			<view class="head_right">
				<view class="show" @click="jia">
					<image src="@/static/images/slices/icon_wddc_tianjia.png" mode=""></image>
				</view>
				<!-- <view class="zhuan">
					<image src="@/static/images/slices/icon_bai_zhunfa.png" mode=""></image>
				</view> -->
			</view>
		</view>
		<u-action-sheet :actions="listJia" :show="createShow" @close="colse2" @select="createJia"
			:cancelText="'取消'"></u-action-sheet>
		<view class="box" :style="{ marginTop: statusBarHeight + 'px' }">
			<view class="all_detail">
				<!-- 奥义预览提示 -->
				<u-alert :title="Previewtitle" type="info" v-if="api_is_shi  && type == 1 " @click="getPrice"></u-alert>
				<!-- 大成预览提示 -->
				<u-alert :title="Previewtitle" type="info" v-if="api_is_shi && (shikan_price > 0) && type == 2" @click="getPrice"></u-alert>

				<!-- 内容 -->
				<view class="box_it">
					<!-- 音频或视频展示 -->
					<view :style="{ marginBottom: '20rpx' }" v-if="detail.kecheng_type == 2">
						<view class="audio_box" @click="play">
							<image class="cover_img" :src="detail.kecheng_file_img_url" mode=""></image>
							<image class="btn_img" src="@/static/images/icon_dtym_bofang.png" mode="widthFix"></image>
						</view>
					</view>
					<view :style="{ marginBottom: '20rpx' }" v-if="detail.kecheng_type == 1">
						<view style="
                width: 100%;
                display: flex;
                flex-direction: row-reverse;
                padding: 16rpx 0;
                box-sizing: border-box;
              ">
							<text style="color: #55b877; font-size: 32rpx" @click="Cache">下载</text>
						</view>
						<video class="myVideo" :src="api_is_shi ? detail.shi_url : detail.kecheng_file_url" controls
							:poster="detail.kecheng_file_img_url" @ended="ended"></video>
					</view>

					<!-- 富文本 -->
					<u-parse :content="api_is_shi ? detail.shi_content : detail.content"></u-parse>
				</view>
				<view style="width: 100%; padding: 0 30rpx 30rpx; box-sizing: border-box">
					<view class="detailed" v-if="detail.renwu_name" @click="toGuan()">
						<view class="detailed_top">
							<view class="detailed_top_left">
								{{ detail.renwu_name }}
							</view>
							<view class="detailed_top_right">
								<u-icon name="arrow-right"></u-icon>
							</view>
						</view>
						<!-- <view class="detailed_bottom">
				    {{ datas.huodong.renwu_count }}个任务点
				  </view> -->
					</view>
					<!-- 图书 -->
					<view class="detailed" v-if="detail.tushu_name" @click="toTusu()">
						<view class="detailed_top">
							<view class="detailed_top_left">
								{{ detail.tushu_name }}
							</view>
							<view class="detailed_top_right">
								<u-icon name="arrow-right"></u-icon>
							</view>
						</view>
						<!-- <view class="detailed_bottom">
				    {{ datas.huodong.renwu_count }}个任务点
				  </view> -->
					</view>

					<template v-if="detail.xunlianying_arr && detail.xunlianying_arr.length">
						<view class="detailed" v-for="(item, index) in detail.xunlianying_arr" @click="toXunlian(item)">
							<view class="detailed_top">
								<view class="detailed_top_left">
									{{ item.title }}
								</view>
								<view class="detailed_top_right">
									<u-icon name="arrow-right"></u-icon>
								</view>
							</view>
						</view>
					</template>
				</view>
			</view>

			<view class="h"> </view>
			<view class="operate">
				<view class="operate_tabs">
					<!-- <u-tabs class="tabs" :list="list1" @click="click" :activeStyle="{
              color: '#444',
              fontWeight: 'bold',
              transform: 'scale(1.05)',
              'font-size': '32rpx',
            }" lineColor="#444444" :inactiveStyle="{
              color: '#888888',
              transform: 'scale(1)',
              'font-size': '32rpx',
            }" :scrollable="false"></u-tabs> -->
					<view class="operate_content" v-if="currentIndex == 0">
						<!-- <reviewContent
              :reply="false"
              :text="'期待上线啊，抢第一批去看！'"
            ></reviewContent>
            <reviewContent :text="'期待上线啊，抢第一批去看！'"></reviewContent> -->
						<view class="empty_view" v-if="list && list.length == 0">
							<image class="item_left_clickable" src="@/static/images/my/kong.png" mode=""></image>
							<view>当前暂无评论~</view>
						</view>
						<reviewContent ref="review" :reply="true" :reply_one="true" v-for="(item, index) in list"
							:value="item" :index="index" :id="id" :module_id="type" :shenfen="datas.shenfen"
							:my_level_id="my_level_id" @reply="handReply" @replyC="handReply1" @refresh="refresh">
						</reviewContent>
						<view class="" style="width: 100%; height: 120rpx"> </view>

						<view class="zhezhao" v-if="isZhe" @click="zheColse"> </view>

						<view class="operate1">
							<scroll-view :scroll-top="99999" scroll-y="true" class="scroll-Y">
								<view class="operate_top">
									<view class="inp" :style="{
                      width: !inp || plImage.length ? '502rpx' : '340rpx',
                    }">
										<u--input :focus="focusKuwei" :placeholder="plsText" border="none"
											placeholderStyle="font-size:30rpx;color:#ADADAD;" color="#ADADAD"
											v-model="value" @change="change" inputAlign="left" @focus="focus"
											@blur="blur"></u--input>
									</view>
									<view class="operate_r" v-if="inp && plImage.length == 0">
										<view class="operate_item1" @click="handLike(detail.is_like)">
											<image src="@/static/images/slices/icon_tlzxq_dianzan_xuanzhong.png" mode=""
												v-if="detail.is_like"></image>
											<image src="@/static/images/slices/icon_tlzxq_dianzan.png" mode="" v-else>
											</image>
											<view class="item_text" :style="{
                          color: detail.is_like ? '#55B877' : '#888888',
                        }">
												点赞
											</view>
										</view>
										<view class="operate_item1">
											<image src="@/static/images/slices/icon_tlzxq_zhuanfa.png" mode=""></image>
											<view class="item_text"> 转发 </view>
										</view>
										<view class="operate_item1" @click="handCollect(detail.is_collect)">
											<image src="../../static/images/slices/icon_bai_shoucang.png" mode=""
												v-show="!detail.is_collect"></image>
											<image src="@/static/images/slices/icon_shoucang_z.png" mode=""
												v-show="detail.is_collect"></image>
											<view class="item_text" :style="{
                          color: detail.is_collect ? '#55B877' : '#888888',
                        }">
												收藏
											</view>
										</view>
									</view>
									<view class="sending_btn" v-else-if="!inp || plImage.length" @click="send">
										发送
									</view>
								</view>

								<view class="mod_img" v-if="fileType == 2 && isZhe">
									<image :src="item.preview_url" v-for="(item, index) in plImage"></image>
								</view>
								<view style="
                    width: 100%;
                    padding: 0 50rpx 0 30rpx;
                    box-sizing: border-box;
                  " v-if="fileType == 1 && isZhe">
									<com-audio :showDelBtn="true" :src="plImage[0].preview_url"></com-audio>
								</view>

								<view class="mod_icon" v-if="isZhe">
									<view class="check_image" @click.stop="current_icon = 0">
										<image src="@/static/images/icon_tlzxq_jianpan.png" mode=""></image>
									</view>
									<view class="check_image" @click.stop="current_icon = 1">
										<image src="@/static/images/icon_tlzxq_yuyin.png" mode=""></image>
									</view>
									<view class="check_image" @click.stop="uploadFile">
										<image src="@/static/images/icon_tlzxq_tupian.png" mode=""></image>
									</view>
								</view>

								<view class="mod_sound_btn" v-if="current_icon == 1 && isZhe">
									<view class="btn_view" @touchstart.stop="touchstart" @touchend.stop="touchend">
										<text class="btn_view_time" v-show="!isTranscribe">00.000</text>
										<u-count-to v-show="isTranscribe" :autoplay="autoplay" ref="uCountTo"
											:startVal="0" :endVal="60" :decimals="3" :duration="60000"
											:useEasing="false" fontSize="48rpx" color="#fff"></u-count-to>
										<!-- <view class="btn_view_time">{{ time }}</view> -->
										<view class="btn_view_text" v-if="!isTranscribe">{{
                      start
                    }}</view>
										<view class="btn_view_text" v-if="isTranscribe">{{
                      end
                    }}</view>
									</view>
								</view>
							</scroll-view>
						</view>
					</view>
					<!-- <view class="operate_content" v-else>
						<view class="operate_item" v-for="(itemVal, ind) in detail.xunlianying_arr" :key="ind"
							@click="goXunlian(itemVal)">
							<view class="item_left">
								<image src="@/static/images/juxing96.png" mode=""></image>
							</view>
							<view class="item_right">
								<view class="right_title"> {{ itemVal.title }} </view>
								<view class="right_participate">
									去参与
									<u-icon name="arrow-right" color="#ADADAD" size="18"></u-icon>
								</view>
							</view>
						</view>
					</view> -->
				</view>
			</view>
		</view>
		<player :key="0" ref="player" :show="show" @colse="colse"></player>
		<u-popup :show="showLimits" @close="closeMod" @open="openMod" :closeable="true">
			<view class="pop_view">
				<view class="pop_title"> 权限 </view>
				<view class="pop_prompt">
					<text>*</text>您还没有观看该课程的权限，您可以选择单独购买该课程，或选择解锁会员，享更多权益
				</view>
				<view class="pop_price">￥{{ bugPrice }}</view>
				<view class="pop_priceText">当前课程价格</view>
				<view class="pop_btn">
					<u-button type="primary" text="单独购买" shape="circle" color="#55b877" class="pop_btn_item"
						v-if="detail.see_fee > 0" @click="goPay"></u-button>
					<u-button type="primary" text="去开通会员" shape="circle" color="#55b877" class="pop_btn_item"
						v-if="my_level_id < detail.see_ask" @click="goVip"></u-button>
				</view>
			</view>
		</u-popup>

		<u-popup mode="center" :show="show1" @close="close1" @open="open1">
			<view class="pop_live">
				<view class="pop_live_title">
					请选择查看需要的行者权限
				</view>
				<u-radio-group v-model="live" activeColor="rgb(85, 184, 119)" iconPlacement="right">
					<view class="pop_live_box">
						<view class="pop_live_item" style="display: flex;align-items: center;"
							@click="handLive(item.level_id)" v-for="(item,index) in liveList" :key="item.level_id">
							<!-- 元气驿站 -->
							{{item.level_name}}
							<u-radio :name="item.level_id"></u-radio>
						</view>
						<!-- <view class="pop_live_item" style="display: flex;align-items: center;" @click="handLive(2)">
						启初梦谷
						<u-radio :name="2"></u-radio>
					</view>
					<view class="pop_live_item" style="display: flex;align-items: center;" @click="handLive(3)">
						青空天台
						<u-radio :name="3"></u-radio>
					</view>
					<view class="pop_live_item" style="display: flex;align-items: center;" @click="handLive(4)">
						无极云顶
						<u-radio :name="4"></u-radio>
					</view>
					<view class="pop_live_item" style="display: flex;align-items: center;" @click="handLive(5)">
						返朴归源
						<u-radio :name="5"></u-radio>
					</view> -->

						<view class="pop_live_btn">
							<view class="live_btn" @click="liveColse">
								取消
							</view>
							<view class="live_btn" style="background: rgb(85, 184, 119);color: #fff;"
								@click="liveSubmit">
								确定
							</view>
						</view>
					</view>

				</u-radio-group>
			</view>
		</u-popup>

	<floatingBall></floatingBall>
	</view>
</template>

<script>
	import reviewContent from "@/pages/bigResult/reviewContent.vue"; //评论
	import {
		dacheng_hudong,
		dacheng_pinglun,
		dacheng_hudong_c,
		dianzan,
		shoucang,
	} from "@/common/api/dacheng.js";
	import config from "@/config"; // 配置文件
	import storage from "@/common/storage.js"; // 缓存封装
	import getRecorderManager from "@/common/getRecorderManager.js";
	import comAudio from "@/pages/components/audio.vue"; //语音条
	import {
		bofang_list,
		add_log
	} from "@/common/api/play.js"; // 播放
	// import player from "@/common/player.js";
	export default {
		components: {
			reviewContent,
			comAudio,
		},
		data() {
			return {
				statusBarHeight: 0,
				height: 0,
				currentIndex: 0,
				list1: [{
						name: "互动",
					},
					{
						name: "其他",
					},
				],
				detail: {},
				type: "",
				id: "",
				list: [],
				inp: true,
				focusKuwei: false,
				plsText: "写回复",
				value: "",
				replyId: 0,
				toUserId: 0,
				datas: {},
				is_c: false,
				currentIndex1: 0,
				videoContext: "",
				current_icon: 0,
				plImage: [],
				fileType: 0, // 1音频  2视频
				isTranscribe: false,
				autoplay: false,
				start: "按住说话",
				end: "松开结束",
				isZhe: false,
				createShow: false,
				listJia: [{
						name: "创建星球",
					},
					{
						name: "创建微创",
					},
				],
				kecheng_id: 0,
				interval: "",
				show: false,
				showHtml: true,
				my_level_id: 0,
				api_is_shi: 0,
				Previewtitle: "当前为试看内容，若观看全部内容请开通相应会员等级或购买。点击解锁全部",
				showLimits: false, // 弹出层显示关闭
				bugPrice: 0,
				showOne: false,
				show1: false,
				live: 0,
				liveList: []
			};
		},
		onShow() {
			// console.log('?????????????????进入日日日日日日日日日日日日日日日日日日日');
			// if (this.$refs.player) {
			//   this.$refs.player.setIntervalT();
			// }
		},
		async onLoad(options) {
			this.type = options.type;
			this.id = options.id;
			this.kecheng_id = options.kecheng_id;
			// console.log('?????????????????进入日日日日日日日日日日日日日日日日日日日',this.$refs.player);
			setTimeout(() => {
				if (this.$refs.player) {
					this.$refs.player.setIntervalT();
				}
			}, 2000);

			if (options && options.type == 1) {
				// 研修奥义详情
				await this.getKeDetail();
			} else if (options.type == 2) {
				// 大成学堂详情
				await this.getDaDetail();
			}

			this.hudongList();

			if (!this.api_is_shi) {
				// 统计学习时长
				this.interval = setInterval(() => {
					this.subDuration(); // 统计时长
					var myDate = new Date(); //获取当前秒数(0-59)
					console.log(myDate.toLocaleTimeString(), "当前秒数");
				}, 1000 * 60);
			}
		},
		//   退出页面
		onUnload() {
			console.log("退出页面了");
			clearInterval(this.interval);
		},
		created() {
			const statusBarHeight = uni.getSystemInfoSync(); // 获取手机状态栏高度

			this.statusBarHeight = statusBarHeight.statusBarHeight;
			this.$nextTick(() => {
				uni
					.createSelectorQuery()
					.select(".head")
					.boundingClientRect((data) => {
						this.height = data.height;
					})
					.exec();
			});
		},
		mounted() {},
		methods: {
			open1() {

			},
			close1() {
				this.show1 = false;
			},
			getPrice() {
				this.showLimits = true;
				this.bugPrice = this.detail.see_fee;
			},
			// 弹出层打开
			openMod() {
				this.showLimits = true;
				console.log("open");
			},
			// 弹出层关闭
			closeMod() {
				this.showLimits = false;
				console.log("close");
			},
			// 跳转订单页
			goPay() {
				// console.log(this.selectDetail, "选中详情");
				uni.navigateTo({
					url: `/pages/detail/wenOrder?type=${
          this.type
        }&from=kecheng&detail=${JSON.stringify(this.detail)}`,
				});
			},
			goVip() {
				uni.navigateTo({
					url: `/pages/member/index`,
				});
			},
			ended() {
				if (!this.api_is_shi) {
					// console.log("视频播放完成触发");
					this.yanEnd(this.kecheng_id, this.id);
					this.$http
						.kechengShoutingwancheng({
							id: this.detail.id,
						})
						.then((res) => {
							console.log(res, "播放完了");
						})
						.catch((error) => {
							uni.$u.toast(error);
						});
				}
			},
			refresh() {
				this.hudongList();
			},
			zheColse() {
				this.isZhe = false;
				this.fileType = 0;
				this.plImage = [];
				this.current_icon = 0;
			},
			// 视频播放完触发
			load() {
				console.log("dom加载完了");
				this.videoContext = uni.createVideoContext("myVideo");
			},
			// 统计时长
			subDuration() {
				this.$http
					.kechengXuexi({
						zhangjie_id: this.id,
						time: 1,
					})
					.then((res) => {
						// this.detail = res.data.info;
						// console.log("detail", this.detail);
						console.log(res, "统计时长");
					})
					.catch((error) => {
						uni.$u.toast(error);
					});
			},
			// 研修完成
			yanEnd(kecheng_id, zhangjie_id) {
				this.$http
					.kechengYanxiu_end({
						kecheng_id: kecheng_id,
						zhangjie_id: zhangjie_id,
					})
					.then((res) => {
						// this.detail = res.data.info;
						// console.log("detail", this.detail);
						console.log(res, "研修完成");
					})
					.catch((error) => {
						uni.$u.toast(error);
					});
			},
			toBack() {
				uni.navigateBack({
					delta: 1,
				});
			},
			click(e) {
				this.currentIndex = e.index;
			},
			// 跳训练营
			goXunlian(itemVal) {
				uni.navigateTo({
					url: `/pages/training/trainDetail?id=${itemVal.id}`,
				});
			},
			change() {},
			focus() {
				this.inp = false;
				this.isZhe = true;
			},
			blur() {
				setTimeout(() => {
					this.inp = true;
				}, 0);
				this.focusKuwei = false;
				this.plsText = "写回复";
			},
			download() {},
			// 大成学堂详情
			getDaDetail() {
				this.$http
					.kechengDacheng_info({
						id: this.id,
					})
					.then((res) => {
						this.detail = res.data.info;
						// 是否是试看
						this.api_is_shi = this.detail.api_is_shi;
						this.my_level_id = this.detail.my_level_id;
						this.shikan_price = res.data.k_info.price
						console.log("detail", this.detail);
						console.log(this.detail, "大成学堂详情");
						// this.my_level_id =
						if (this.detail.kecheng_type == 0) {
							// 图文   文本域字段
							setTimeout(() => {
								this.yanEnd(this.kecheng_id, this.id);
							}, 1000);
						}
					})
					.catch((error) => {
						uni.$u.toast(error);
					});
			},
			hudongList() {
				dacheng_hudong({
					id: this.id,
				}).then((res) => {
					console.log("resssss", res);
					this.list = res.data.list.data;
				});
			},
			// 研修奥义详情
			getKeDetail() {
				this.$http
					.kechengInfo({
						id: this.id,
					})
					.then((res) => {
						this.detail = res.data.info;
						// 是否是试看
						this.api_is_shi = this.detail.api_is_shi;
						this.my_level_id = this.detail.my_level_id;
						this.shikan_price = this.detail.see_fee
						// console.log(this.detail, "研修奥义详情");
						console.log(this.my_level_id,'我的等级')
						console.log(this.detail.see_ask,'观看等级')
						console.log(this.shikan_price,'章节价格')
						if (this.detail.kecheng_type == 0) {
							// 图文   文本域字段
							setTimeout(() => {
								this.yanEnd(this.kecheng_id, this.id);
							}, 1000 * 60);
						}
					})
					.catch((error) => {
						console.log(this.detail, "报错了");
						setTimeout(() => {
							uni.navigateBack({
								delta: 1,
							});
						}, 800);

						uni.$u.toast(error);
					});
			},
			handReply(val, index) {
				console.log("vallll", val);
				this.plsText = "回复@ " + val.user.nick_name;
				this.replyId = val.id;
				this.toUserId = val.user.user_id;
				this.focusKuwei = true;
				this.is_c = true;
				this.currentIndex1 = index;
			},
			handReply1(val, item, index) {
				console.log("vallll111", val);
				this.plsText = "回复@ " + val.user.nick_name;
				this.replyId = item.id;
				this.toUserId = val.user.user_id;
				this.focusKuwei = true;
				this.showMode = true;
				this.is_c = true;
				this.currentIndex1 = index;
			},
			handLike(val) {
				dianzan({
					id: this.id,
					comment_id: 0,
					like_user_id: 0,
					module_id: this.type == 1 ? 9 : 10,
				}).then((res) => {
					if (val) {
						this.detail.is_like = 0;
						this.$u.toast("点赞取消");
					} else {
						this.detail.is_like = 1;
						this.$u.toast("点赞成功");
					}
				});
			},
			handCollect(val) {
				shoucang({
					id: this.id,
				}).then((res) => {
					console.log("resssss", res);
					if (val == 0) {
						this.detail.is_collect = 1;
					} else {
						this.detail.is_collect = 0;
					}
				});
			},
			touchstart() {
				console.log("2222");
				this.isTranscribe = true;
				getRecorderManager.startManager();
				this.$refs.uCountTo.start();
			},
			toGuan(item) {
				console.log('tttttttttt',item);
				
				if (this.detail.renwu) {
					uni.navigateTo({
						url: "/pages/character/characterDetail?id=" + this.detail.renwu,
					});
				}
			},
			toTusu() {
				if (this.detail.tushu) {
					uni.navigateTo({
						url: "/pages/book/detail?id=" + this.detail.tushu,
					});
				}
			},
			toXunlian(item) {
				uni.navigateTo({
					url: "/pages/training/trainDetail?id=" + item.id,
				});
			},
			async touchend() {
				console.log("33333");
				this.isTranscribe = false;
				let that = this;
				let token = storage.get("token");
				const url = await getRecorderManager.stopManager();
				console.log("222222222", url);
				uni.uploadFile({
					url: config.uni_app_web_api_url + "/api/upload/audio", // 仅为示例，非真实的接口地址
					filePath: url,
					name: "file",
					formData: {
						user: "test",
					},
					header: {
						"Access-Token": token,
					},
					success: (res) => {
						const data = JSON.parse(res.data);

						console.log("resssssssss", data);
						that.plImage = [{
							file_id: data.data.fileInfo.file_id,
							preview_url: data.data.fileInfo.external_url,
						}, ];
						that.fileType = 1;
					},
				});
			},
			uploadFile() {
				let token = storage.get("token");
				let that = this;
				uni.chooseImage({
					count: 6, //默认9
					sizeType: ["original", "compressed"], //可以指定是原图还是压缩图，默认二者都有
					sourceType: ["album"], //从相册选择
					success: function(res) {
						console.log(JSON.stringify(res.tempFilePaths));

						uni.uploadFile({
							url: config.uni_app_web_api_url + "/api/upload/image", // 仅为示例，非真实的接口地址
							filePath: res.tempFilePaths[0],
							name: "file",
							formData: {
								user: "test",
							},
							header: {
								"Access-Token": token,
							},
							success: (res) => {
								const data = JSON.parse(res.data);
								console.log("resssss", res, data.data.fileInfo);
								that.plImage = [{
									file_id: data.data.fileInfo.file_id,
									preview_url: data.data.fileInfo.preview_url,
								}, ];
								that.fileType = 2;
							},
						});
					},
				});
			},
			jia() {
				this.createShow = true;
			},
			open2() {
				this.createShow = true;
			},
			colse2() {
				this.createShow = false;
			},
			createJia(e) {
				console.log("eeeee", e);
				if (e.name == "创建星球") {
					uni.navigateTo({
						url: "/pages/distinguish/createStart?type=10&type_id=" + this.kecheng_id,
					});
				} else if (e.name == "创建微创") {
					uni.navigateTo({
						url: "/pages/bigResult/minute_create",
					});
				}
			},
			play() {
				// this.show = true;
				add_log({
					type: 1,
					id: this.id,
				}).then((res) => {
					// player();
					this.show = true;
					this.$refs.player.getList();
					console.log("ressssss", res);
				});
			},
			//发送消息
			send() {
				console.log("33333", this.value, this.focusKuwei);

				// if (this.is_c) {
				// 	dacheng_hudong_c({
				// 		id:this.replyId
				// 	}).then(res => {
				// 		console.log('ressss',res);
				// 	})

				// 	this.is_c = false;
				// } else {


				this.$http.userLevelList({}).then(res => {
					if (res.data.userInfo.is_teacher == 1 || res.data.userInfo.is_senators == 1) {
						this.show1 = true;
						console.log('reessssssliiive', res);
						this.liveList = res.data.list;
						this.liveList.unshift({
							level_name:'公开',
							level_id:0
						})
					} else {
						this.huifu();
					}
				})



				// }
			},
			huifu(grade_auth = 0) {
				let file_id = 0;
				if (this.plImage.length) {
					file_id = this.plImage[0].file_id;
				}

				let comment_user_id = 0;
				if (this.is_c) {
					comment_user_id = this.toUserId;
				} else {
					comment_user_id = this.detail.user_id;
				}
				dacheng_pinglun({
					id: this.id,
					file_id,
					content: this.value,
					comment_id: this.replyId,
					comment_user_id,
					module_id: this.type == 1 ? 9 : 10,
					grade_auth
				}).then((res) => {
					console.log("ressss", res);
					this.replyId = 0;
					this.value = "";
					this.isZhe = false;
					this.fileType = 0;
					this.current_icon = 0;
					this.plImage = [];
					if (this.is_c) {
						this.$refs.review[this.currentIndex1].expand();
						this.is_c = false;
					}
					this.hudongList();
				});
			},
			Cache() {
				console.log("缓存缓存", this.detail);
				uni.navigateTo({
					url: "/pages/integral/download?url=" +
						this.detail.kecheng_file_url +
						"&file_id=" +
						this.detail.kecheng_file +
						"&name=" +
						this.detail.address_name +
						"&img=" +
						this.detail.kecheng_file_img_url,
				});
			},
			colse() {
				this.show = false;
			},
			handLive(live) {
				this.live = live;
			},
			liveColse() {
				this.show1 = false;
			},
			liveSubmit() {
				this.huifu(this.live);
				this.show1 = false;
			}
		},
	};
</script>

<style scoped lang="scss">
	.content {
		box-sizing: border-box;
	}

	/deep/ .pop_view {
		padding: 0 30rpx;

		.pop_title {
			display: flex;
			justify-content: center;
			margin: 40rpx 0;
			font-size: 32rpx;
		}

		.pop_prompt {
			padding: 32rpx 30rpx;
			background: #f7f8fa;
			border-radius: 16rpx;
			font-size: 28rpx;
			color: #888888;

			text {
				color: #ee6060;
			}
		}

		.pop_price {
			display: flex;
			justify-content: center;
			margin: 40rpx 0 8rpx 0;
			font-size: 48rpx;
			font-weight: 400;
			color: #444444;
		}

		.pop_priceText {
			display: flex;
			justify-content: center;
			margin-bottom: 180rpx;
			font-size: 26rpx;
			color: #888888;
		}

		.pop_btn {
			display: flex;
			justify-content: space-between;
			align-items: center;
			margin-bottom: 40rpx;

			.pop_btn_item {
				margin: 0 10rpx;
			}
		}
	}

	.head {
		width: 100%;
		padding: 18rpx 30rpx 47rpx;
		position: fixed;
		display: flex;
		justify-content: center;
		align-items: center;
		box-sizing: border-box;
		z-index: 99;
		background: #fff;

		.head_left {
			position: absolute;
			left: 30rpx;
		}

		.head_right {
			position: absolute;
			right: 30rpx;
			display: flex;
		}

		.text {
			font-size: 36rpx;
			font-family: PingFang SC-Bold, PingFang SC;
			font-weight: 400;
			color: #444444;
		}
	}

	.show {
		width: 40rpx;
		height: 38rpx;

		image {
			width: 100%;
			height: 100%;
		}
	}

	.zhuan {
		width: 40rpx;
		height: 38rpx;
		margin-left: 40rpx;

		image {
			width: 100%;
			height: 100%;
		}
	}

	.box {
		width: 100%;

		.it_title {
			font-size: 32rpx;
			font-family: PingFang SC, PingFang SC;
			font-weight: 400;
			color: #444444;
		}

		.all_detail {}

		.Preview_model {
			// height: 100%;
			// background: linear-gradient(
			//   360deg,
			//   #ffffff 87%,
			//   rgba(255, 255, 255, 0) 100%
			// );
			// width: 100%;
			// position: absolute;
			// top: 50rpx;
			// z-index: 100;
			// text-align: center;
			// line-height: 100rpx;
			// box-shadow: 0rpx 0rpx 10rpx 0rpx rgba(255, 255, 255, 0.6);
		}

		.box_it {
			width: 100%;
			padding: 0 30rpx 56rpx;
			box-sizing: border-box;
			margin-top: 24rpx;

			.audio_box {
				// width: 300rpx;
				padding: 20rpx 30rpx;
				box-sizing: border-box;
				background: #f4f4f4;
				display: flex;
				align-items: center;
				justify-content: space-between;
				border-radius: 16rpx;

				.cover_img {
					width: 100rpx;
					height: 100rpx;
					border-radius: 8rpx;
				}

				.btn_img {
					width: 80rpx;
					height: 80rpx;
				}
			}

			.myVideo {
				width: 100%;
			}
		}

		.h {
			width: 100%;
			height: 16rpx;
			background: #f7f8fa;
		}

		.operate {
			width: 100%;
			padding: 0 30rpx;
			box-sizing: border-box;

			.operate_tabs {
				border-bottom: 1rpx solid #eee;
			}

			.operate_content {
				width: 100%;

				.operate_item {
					width: 100%;
					margin-top: 32rpx;
					background: #f7f8fa;
					padding: 16rpx 30rpx 16rpx 16rpx;
					border-radius: 16rpx 16rpx 16rpx 16rpx;
					box-sizing: border-box;
					display: flex;

					.item_left {
						width: 168rpx;
						height: 168rpx;

						image {
							width: 100%;
							height: 100%;
						}
					}

					.item_right {
						flex: 1;
						padding: 8rpx 0 8rpx 32rpx;
						box-sizing: border-box;
						display: flex;
						flex-direction: column;
						justify-content: space-between;

						.right_title {
							font-size: 30rpx;
							font-family: PingFang SC, PingFang SC;
							font-weight: 400;
							color: #444444;
						}

						.right_participate {
							display: flex;
							justify-content: flex-end;
							font-size: 28rpx;
							font-family: PingFang SC, PingFang SC;
							font-weight: 400;
							color: #55b877;
						}
					}
				}
			}
		}
	}

	.zhezhao {
		width: 100vw;
		height: 100vh;
		background: rgba(0, 0, 0, 0.5);
		position: fixed;
		top: 0;
		left: 0;
		z-index: 1086;
	}

	.operate1 {
		width: 100%;
		background: #fff;
		box-shadow: 0rpx 4rpx 10rpx 0rpx rgba(0, 0, 0, 0.2);
		position: fixed;
		bottom: 0;
		left: 0;
		display: flex;
		align-items: center;

		padding: 16rpx 30rpx 16rpx 20rpx;
		box-sizing: border-box;
		z-index: 1087;

		.operate_top {
			width: 100%;
			display: flex;
			align-items: center;
		}

		.mod_img {
			display: flex;
			flex-direction: row;
			flex-wrap: wrap;
			padding: 16rpx 30rpx;

			image {
				width: 222rpx;
				height: 222rpx;
				margin-bottom: 12rpx;
				margin-right: 12rpx;
			}

			image:nth-child(3n) {
				margin-right: 0;
			}
		}

		.mod_icon {
			display: flex;
			align-items: center;
			padding: 20rpx 30rpx;
			border-bottom: 1rpx solid #e5e5e5;
			margin-bottom: 38rpx;

			.check_image {
				width: 48rpx;
				height: 48rpx;
				margin-right: 28rpx;

				image {
					width: 48rpx;
					height: 48rpx;
				}
			}

			.mod_icon_item {
				margin-right: 32rpx;
			}
		}

		.mod_sound_btn {
			padding: 106rpx 227rpx;

			.btn_view {
				width: 296rpx;
				height: 296rpx;
				background-image: url("@/static/images/pic_cjwc_luzhi.png");
				background-size: cover;
				background-repeat: no-repeat;
				background-position: center center;
				display: flex;
				justify-content: center;
				flex-direction: column;
				align-items: center;

				.btn_view_time {
					color: #ffffff;
					font-size: 46rpx;
				}

				.btn_view_text {
					color: #ffffff;
					font-size: 26rpx;
					margin-top: 4rpx;
				}
			}
		}

		.inp {
			height: 80rpx;
			background: #f4f4f4;
			border-radius: 40rpx;
			display: flex;
			align-items: center;
			padding-left: 32rpx;
		}

		.operate_r {
			width: 224rpx;
			height: 92rpx;
			display: flex;
			justify-content: space-between;
			align-items: center;
			margin-left: 48rpx;

			.operate_item1 {
				image {
					width: 48rpx;
					height: 48rpx;
				}

				.item_text {
					font-size: 24rpx;
					font-family: PingFang SC, PingFang SC;
					font-weight: 400;
					color: #666666;
					margin-top: 8rpx;
				}
			}
		}

		.sending_btn {
			width: 172rpx;
			height: 80rpx;
			background: #55b877;
			border-radius: 40rpx;
			font-size: 32rpx;
			font-family: PingFang SC, PingFang SC;
			font-weight: 400;
			color: #ffffff;
			display: flex;
			justify-content: center;
			align-items: center;
			margin-left: 16rpx;
		}
	}

	.empty_view {
		margin-top: 100rpx;
		padding-bottom: 100rpx;

		image {
			margin: 0 auto;
			width: 410rpx;
			height: 410rpx;
		}

		view {
			font-size: 30rpx;
			color: #d8d8d8;
			text-align: center;
		}
	}

	.detailed {
		width: 100%;
		padding: 32rpx;
		box-sizing: border-box;
		background: rgb(247, 248, 250);
		margin-top: 40rpx;

		.detailed_top {
			width: 100%;
			display: flex;
			justify-content: space-between;
			align-items: center;

			.detailed_top_left {
				font-size: 32rpx;
				font-family: PingFang SC, PingFang SC;
				font-weight: 400;
				color: #474747;
			}
		}

		.detailed_bottom {
			font-size: 26rpx;
			color: #adadad;
			margin-top: 16rpx;
		}
	}

	.pop_live {
		width: 570rpx;
		// height: 820rpx;
		display: flex;
		flex-direction: column;
		justify-content: center;
		background: #fff;

		.pop_live_title {
			font-size: 30rpx;
			font-family: PingFang SC, PingFang SC;
			font-weight: 400;
			color: #666666;
			padding: 30rpx;
			box-sizing: border-box;
		}

		.pop_live_box {
			width: 100%;
			display: flex;
			flex-direction: column;
			padding: 0 30rpx;
			box-sizing: border-box;

			.pop_live_item {
				width: 100%;
				display: flex;
				justify-content: space-between;
				border-bottom: 1rpx solid #ccc;
				padding: 30rpx 0;
				box-sizing: border-box;
			}
		}

		.pop_live_btn {
			width: 100%;
			display: flex;
			justify-content: space-between;
			align-items: center;
			margin-top: 28rpx;
			margin-bottom: 28rpx;
			.live_btn {
				width: 46%;
				height: 80rpx;
				border-radius: 24rpx;
				border: 1rpx solid #ccc;
				display: flex;
				justify-content: center;
				align-items: center;
			}
		}
	}
</style>